<?php 
	session_start(); 
	class UnpaidManager{
	
		public function validate($order){
		
				if(!(is_numeric($order))&&($order!=null||$order!="")){
					return true;
				}else{
					return false;
				}
		}
	
		public function getData($order){
			if($order == "STUDENTNO" || $order == "NAMELAST")
				$prefix = "a.";
			else
				$prefix = "";
			$conn = oci_connect("naiad", "1234", "localhost/XE");
			$s = oci_parse($conn, "select * from STUDENT a, PAYMENT b, CHECK_IN c where b.STUDENTNO=a.STUDENTNO AND a.STUDENTNO=c.STUDENTNO order by " . $prefix . $order);
			//oci_bind_by_name($s, ":ordering", $order);
			oci_execute($s);
			$nrows = oci_fetch_all($s, $results);
			$_SESSION['results'] = $results;
			$_SESSION['numrows'] = $nrows;
		}
	}
?>